﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using framework.ui;

namespace framework
{
    public partial class Framework : Form
    {

        public Framework()
        {
            InitializeComponent();
        }

        private void OpenFile(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();
            openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
            openFileDialog.Filter = "Mapcode (*.map)|*.map|XMapcode (*.xmap)|*.xmap|Tutti i file (*.*)|*.*";
            if (openFileDialog.ShowDialog(this) == DialogResult.OK)
            {
                string FileName = openFileDialog.FileName;
            }
        }

        private void SaveAsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SaveFileDialog saveFileDialog = new SaveFileDialog();
            saveFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
            saveFileDialog.Filter = "File di testo (*.txt)|*.txt|Tutti i file (*.*)|*.*";
            if (saveFileDialog.ShowDialog(this) == DialogResult.OK)
            {
                string FileName = saveFileDialog.FileName;
            }
        }

        private void ExitToolsStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void CutToolStripMenuItem_Click(object sender, EventArgs e)
        {
        }

        private void CopyToolStripMenuItem_Click(object sender, EventArgs e)
        {
        }

        private void PasteToolStripMenuItem_Click(object sender, EventArgs e)
        { 
        }

        private void ToolBarToolStripMenuItem_Click(object sender, EventArgs e)
        {
            toolStrip.Visible = toolBarToolStripMenuItem.Checked;
        }

        private void StatusBarToolStripMenuItem_Click(object sender, EventArgs e)
        {
            statusStrip.Visible = statusBarToolStripMenuItem.Checked;
        }

        private void CloseAllToolStripMenuItem_Click(object sender, EventArgs e)
        {
            foreach (Form childForm in MdiChildren)
            {
                childForm.Close();
            }
        }

        #region ------------ 1. EVENTS ---------------

        #region ------------ 1.1 Tools ---------------

        private void newCurveGeneratorToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Curve childForm = new Curve();
            childForm.MdiParent = this;
            childForm.Text = "Curve Generator";
            childForm.Show();
        }

        private void newCompilerToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form1 childForm = new Form1();
            childForm.MdiParent = this;
            childForm.Text = "Visual Compiler";
            childForm.Show();
        }

        private void newCurveGeneratorToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            Curve childForm = new Curve();
            childForm.MdiParent = this;
            childForm.Text = "Curve Generator";
            childForm.Show();
        }

        private void newPackageManagerToolStripMenuItem_Click(object sender, EventArgs e)
        {
            PackageManager childForm = new PackageManager();
            childForm.MdiParent = this;
            childForm.Text = "Package Manager";
            childForm.Show();
        }

        private void newCompilerToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            newCompilerToolStripMenuItem_Click(sender, e);
        }

        private void newCurveGeneratorToolStripMenuItem_Click_1(object sender, EventArgs e)
        {
            newCurveGeneratorToolStripMenuItem1_Click(sender, e);
        }

        private void newPackageManagerToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            newPackageManagerToolStripMenuItem_Click(sender, e);
        }

        private void newCompilerToolStripMenuItem2_Click(object sender, EventArgs e)
        {
            newCompilerToolStripMenuItem_Click(sender, e);
        }

        private void newCurveGeneratorToolStripMenuItem2_Click(object sender, EventArgs e)
        {
            newCurveGeneratorToolStripMenuItem1_Click(sender, e);
        }

        private void newPackageManagerToolStripMenuItem2_Click(object sender, EventArgs e)
        {
            newPackageManagerToolStripMenuItem_Click(sender, e);
        }

        #endregion
        #region ------------ 1.2 FrameWork Layout ---------------

        private void CascadeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LayoutMdi(MdiLayout.Cascade);
        }

        private void TileVerticalToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LayoutMdi(MdiLayout.TileVertical);
        }

        private void TileHorizontalToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LayoutMdi(MdiLayout.TileHorizontal);
        }

        private void ArrangeIconsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LayoutMdi(MdiLayout.ArrangeIcons);
        }

        #endregion

        #endregion
    }
}
